import 'package:flutter/material.dart';
import 'package:fzcgx_app/common/adapter_utils.dart';
import 'package:fzcgx_app/common/assets_utils.dart';
import 'package:fzcgx_app/ui/my/factory/model/factory_product_category_model.dart';

class CustomDelChipWidget extends StatefulWidget {
  CustomDelChipWidget({Key key, this.onDeleteTap, this.model})
      : super(key: key);
  final Function onDeleteTap;
  final FactoryProductCategoryModel model;
  @override
  _CustomDelChipWidgetState createState() => _CustomDelChipWidgetState();
}

class _CustomDelChipWidgetState extends State<CustomDelChipWidget> {
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: widget.onDeleteTap,
      child: Container(
          padding: EdgeInsets.symmetric(
            horizontal: AdapterUtils.getWidth(15),
            //  vertical: AdapterUtils.getHeight(8)
          ),
          margin: EdgeInsets.only(right: AdapterUtils.getWidth(10)),
          decoration: BoxDecoration(
              border: Border.all(color: Color(0xffFF3D3E), width: 1),
              borderRadius: BorderRadius.all(Radius.circular(17.5))),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text(
                widget.model.name,
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontSize: AdapterUtils.getSp(14),
                  color: Color(0xffFF3D3E),
                  fontWeight: FontWeight.w500,
                ),
              ),
              SizedBox(
                width: AdapterUtils.getWidth(8),
              ),
            Padding(padding: EdgeInsets.only(top: AdapterUtils.getHeight(3)),child:  Image.asset(AssetsUtils.getAssetsImagesPath('close.png')),)
            ],
          )),
    );
  }
}
